/** \file visitor.h
* A visitor structure for the graph nodes
*/
#ifndef _VISITOR_H
#define _VISITOR_H

#include <gminiGraph.h>
#include <iostream>


using namespace std;
/**
* \class Visitor
* \author Layale Constantine & Jad Makhlouta 
* \brief defines the Visitor class structure
*
*/
class Visitor
{
public:
	virtual void initialize()=0;
	virtual void visitEdge(Edge * e/*!<Visited edge*/)=0;
	virtual void visitNode(Node * n/*!<Visited node*/)=0;
	virtual void finish()=0;
};

/**
* \class Visitor
* \author Layale Constantine & Jad Makhlouta 
* \brief defines the Visitor class structure
*
*/
class DisplayVisitor: public Visitor
{
public:
	/**
	*\brief implementation left to aspects 
	*
	*/
	virtual void initialize()
	{} 
	/**
	*\brief visits an edge by printing its label.
	*
	*/	
	virtual void visitEdge(Edge * e/*!<Visited edge*/)
	{cout<<"--"<< e->getLabel()<<"-->\n";}
	/**
	*\brief visits a node by calling Node::print() function
	*
	*/
	virtual void visitNode(Node * n/*!<Visited node*/)
	{cout << n->print()<<"\n";}

	/**
	*\brief implementation left to aspects 
	*
	*/
	virtual void finish()
	{}
};


#endif
